  
    <h1>Machines <% if authenticated? %>
          <%= link_to ' >> Ajouter', new_machine_path %>
       <% end  %></h1>
    <h3></h3>
      <br/>
      <div id="newMachineTitle" style="" align="left" >


      </div>
     <br/>
     <div id="newMachineTitle" style="" align="left" >
     <% form_tag(:controller=>'machines', :action=>'rechercher') do %>
       <table>
        <tr>
          <td><%= text_field :name, @machine %></td>
          <td><%= submit_tag 'Rechercher' %></td>
        </tr>
      </table>
     <% end %>
       </div>

      <br/>
       <br/>
  

    <table width="100%">
      <tr  bgcolor="#999999">
        <td>Num</td>
        <td>Nom</td>
        <td>Adresse IP</td>
        <td>MAC</td>
        <td>Système</td>
        <td>Memoire</td>
        <td>Espace de stockage</td>
        <td>Salle</td>
        <td colspan="4">Opérations</td>
      </tr>

    <% @machines.each_with_index do |machine, index|
        if (index%2==0)
          col ="#CCCCCC"
        else
          col = "#FFFFFF"
        end

      %>
        <tr bgcolor="<%=h col %>" >
        <td><%=h machine.id %></td>
        <td><%=h machine.nommachine %></td>
        <td><%=h machine.ipmachine %></td>
        <td><%=h machine.addmac %></td>
        <td><%=h machine.os %></td>
        <td><%=h machine.memoiretotale %></td>
        <td><%=h machine.espacedisquet %></td>
        <td>
             <!--<%=h  machine.salleid %>-->
              <%=h  machine.nomsalle %>

        </td>
        <td><%= link_to image_tag("point.png", :size => "16x16", :alt => "Interrogation"), :controller => "machines", :action => "interomachine", :id => machine.id %></td>
        <td><%= link_to image_tag("voir.png", :alt => "Voir"), machine %></td>
        <% if authenticated? %>
        <td><%= link_to image_tag("edit.png", :alt => "Modifier"), edit_machine_path(machine) %></td>
        <td><%= link_to image_tag("supp.png", :alt => "Suppression"), machine, :confirm => 'Etes vous sûr de vouloir supprimer cet enregistrement?', :method => :delete %></td>
        <% end %>
      </tr>

    <%  end %>
    </table>
 
   <br/>